﻿using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using Wicture.EPC.OnlineQueryProxy.Processors;

namespace Wicture.EPC.OnlineQueryProxy
{
    public class QueryRequest
    {
        public QueryProcessorTask Task { get; set; }
        public Guid RequestId { get; set; } = Guid.NewGuid();
        public string AgentId { get; set; }
        [JsonIgnore]
        public string ParamString { get; set; }
        public object Params
        {
            get
            {
                return JsonConvert.DeserializeObject<JObject>(ParamString);
            }
        }
        public QueryRequest()
        {

        }
        public QueryRequest(string @params, string agentId)
        {
            ParamString = @params;
            AgentId = agentId;
        }
    }
}
